package com.woniu.order.client;

import com.woniu.order.client.param.AddCartParam;
import com.woniu.order.client.param.ModifyCartParam;
import com.woniu.result.Result;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

/**
 * name是项目名，contextId是client的名字
 */
@FeignClient(contextId = "cartManageClient", name = "order")
public interface CartManageClient {

    /**
     * 加入购物车
     *
     * @param addCartParam
     * @return
     */
    @PostMapping("addCart")
    public Result addCart(@RequestBody AddCartParam addCartParam);

    /**
     * 删除购物车某条商品
     */
    @DeleteMapping("delCart")
    public Result delCart(@RequestParam("skuId") Integer skuId);

    /**
     * 修改购物车商品数量
     * @param modifyCartParam
     * @return
     */
    @PutMapping("modifyCart")
    public Result modifyCart(@RequestBody ModifyCartParam modifyCartParam);
}
